//
//  YCPopUpMenu.h
//  DemoMenuMore
//
//  Created by swustyc on 16/5/9.
//  Copyright © 2016年 swustyc. All rights reserved.
//

#import <UIKit/UIKit.h>

#pragma mark - YCPopUpMenuItem

/**
 *  弹出式菜单子项
 */
@interface YCPopUpMenuItem : NSObject

/// 图标
@property (nonatomic, strong, readwrite) UIImage *img;
/// 文字
@property (nonatomic, strong, readwrite) NSString *title;
/// 操作对象
@property (readwrite, nonatomic, weak) id target;
/// 操作
@property (readwrite, nonatomic) SEL action;

/// 标题颜色
@property (readwrite, nonatomic, strong) UIColor *titleColor;

/**
 *  获取菜单子项
 *
 *  @param title  标题
 *  @param img    图片
 *  @param targe  操作对象
 *  @param action 操作
 *
 *  @return 实例
 */
+ (instancetype)menuItem:(NSString *)title
                   image:(UIImage *)img
                  target:(id)targe
                  action:(SEL)action;

@end

#pragma mark - YCPopUpMenu

/**
 *  弹出式菜单
 */
@interface YCPopUpMenu : NSObject

/**
 *  显示菜单
 *
 *  @param view      点击的控件
 *  @param menuItems 菜单子项
 */
- (void)showFromView:(UIView *)view menuItems:(NSArray<YCPopUpMenuItem *> *)menuItems;
/**
 *  隐藏菜单
 */
- (void)dismiss;

@end
